package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.PrintFileStatus;

@Converter(autoApply = true)
public class PrintFileStatusConvert implements AttributeConverter<PrintFileStatus, Integer> {

	@Override
	public Integer convertToDatabaseColumn(PrintFileStatus attribute) {
		return attribute.getValue();
	}

	@Override
	public PrintFileStatus convertToEntityAttribute(Integer dbData) {
		return PrintFileStatus.fromValue(dbData);
	}

}
